Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle macros in lints #263

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

Conversation

DaAlbrecht
Copy link
Contributor

@DaAlbrecht DaAlbrecht commented Feb 8, 2025

Closes #167

  • borrowed_reborrowable
  • insert_event_resource
  • insert_unit_bundle -> Check if the span of the "spawn" method call is from an external crate
  • main_return_without_appexit
  • missing_reflect
  • panicking_methods
  • plugin_not_ending_in_plugin
  • zst_query

Bugs:

  • insert_event_resource: fix macro rustfix
  • missing_reflect seems to have an issue with the span's when using "local" macros


#[derive(Event)]
struct Foo;

macro_rules! local_macro {
() => {
App::new().init_resource::<Events<Foo>>();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why rustfix does not fix the macro.. the span is correct but the suggestion is not applied

@DaAlbrecht
Copy link
Contributor Author

For borrowed_reborrowable what do you think if we check that the function span:https://github.com/TheBevyFlock/bevy_cli/blob/main/bevy_lint/src/lints/borrowed_reborrowable.rs#L110 does not originate from an external macro? @BD103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Decide how to deal with macros in lints
1 participant